<%@ page language="java"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <title>我的进度报告</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!-- 引用新样式 start -->
    <jsp:include page="../../jsp/public.jsp" flush="true"/>
    <!-- end -->
    <style type="text/css">
        .textBtn {
            position: absolute;
            right: 10px;
            bottom: 10px;
            top: 45px;
            right: 18px;
        }
    </style>
    <script type="text/javascript" src="<%=basePath%>js/new/jquery.min.js" charset="utf-8"></script>
    <script>
        //提交表单
        function queryModelList() {
            var data = $("#queryForm").serialize();
            window.location.href = "<%=path%>/bus/progress/myProgressReport?" + data;
        }

        //跳转到新增进度页面
        function toEditProgress(id) {
            $("#mapId").val(id);
            var data = $("#queryForm").serialize();
            window.location.href = "<%=path%>/bus/progress/toEditProgress?" + data;
        }
    </script>
<body>
<div class="col-lg-12">
    <div class="index-nav-right">
        <div class="index-nav-right-header"><span>当前位置 > 厂商平台 > <b>我的进度报告</b></span></div>
    </div>
    <div class="right-table">
        <form id="queryForm" method="post" action="<%=path%>/bus/progress/myProgressReport">
            <input hidden="true" type="text" id="mapId" name="mapId">
            <input hidden="true" type="text" id="mapPage" name="mapPage" value="${map['page'] }">
            <div class="search-form">
                <div class="search-form-input">
                    <label>机种:</label>
                    <select name="modelType" id="modelType">
                        <option value="">请选择</option>
                        <c:if test="${not empty mTypeList}">
                            <c:forEach items="${mTypeList }" var="mTypeList"
                                       varStatus="m">
                                <option value="${mTypeList.targetName}"
                                        <c:if test="${map['modelType'] ==mTypeList.targetName }">selected</c:if>>${mTypeList.targetName}</option>
                            </c:forEach>
                        </c:if>
                    </select>
                </div>
                <div class="search-form-input">
                    <label>部品番号</label><input type="text" name="modelCode" id="modelCode"
                                              value="${map['modelCode'] }"/>
                </div>

                <div class="search-form-input" style="border: 0px solid red;width: 200px;">
                    <label>状态</label>
                    <select name="status" id="status">
                        <option value="">请选择</option>
                        <option value="-2" <c:if test="${map['status'] =='-2' }">selected</c:if>>待提交</option>
                        <option value="0" <c:if test="${map['status'] =='0' }">selected</c:if>>待审核</option>
                        <option value="1" <c:if test="${map['status'] =='1' }">selected</c:if>>待二审</option>
                        <option value="2" <c:if test="${map['status'] =='2' }">selected</c:if>>已通过</option>
                        <option value="3" <c:if test="${map['status'] =='3' }">selected</c:if>>已拒绝</option>
                    </select>
                </div>
                <!-- <div class="search-form-btn search-form-input">
                     <ul class = "textBtn">
                         <li>
                             <button class="search-form-btn-s" onClick = "queryModelList()">搜索</button>
                         </li>
                     </ul>
                 </div>	 -->
                <div class="search-form-btn search-form-input" style="border: 0px solid red;">
                    <button type="submit" class="btn btn-primary search-form-btn-s" style="color: black;">搜索</button>
                </div>


            </div>

            <div class="index-table">
                <table class="table table-striped" action="<%=path%>/bus/progress/myProgressReport">
                    <thead>
                    <tr class="table-thead">
                        <th>序号</th>
                        <th>机种</th>
                        <th>部品番号</th>
                        <th>汇报日期</th>
                        <th>当前进度</th>
                        <th>延期/提前</th>
                        <th>审核建议</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:if test="${not empty list}">
                        <c:forEach items="${list }" var="report" varStatus="r">
                            <tr>
                                <td>${r.index+1 }</td>
                                <td>${report.modelType }</td>
                                <td>${report.modelCode }</td>
                                <td>${report.reportDate }</td>
                                <td>${report.currentPro }</td>
                                <td>
                                    <c:if test="${report.progressStatus=='提前' }">
                                        <b style="color:blue;">${report.extDay }</b>
                                    </c:if>
                                    <c:if test="${report.progressStatus=='延期' }">
                                        <b style="color:red;">${report.extDay}</b>
                                    </c:if>
                                    <c:if test="${report.progressStatus=='0' or report.progressStatus==null or report.progressStatus=='正常'}">
                                        <b>${report.extDay }</b>
                                    </c:if>
                                </td>
                                <td>
                                    <c:if test="${report.status=='待二审' }">
                                        ${report.advise }
                                    </c:if>
                                    <c:if test="${report.status=='已通过' || report.status=='已拒绝'}">
                                        <c:if test="${report.reviewAdvise=='' || report.reviewAdvise==null }">
                                            ${report.advise }
                                        </c:if>
                                        <c:if test="${report.reviewAdvise !='' && report.reviewAdvise!=null }">
                                            ${report.reviewAdvise }
                                        </c:if>

                                    </c:if>
                                </td>
                                <td>
                                    <c:if test="${report.status=='已拒绝' }">
                                        <b style="color: red;border: 0px solid red;">${report.status}</b>
                                    </c:if>
                                    <c:if test="${report.status!='已拒绝' }">
                                        ${report.status}
                                    </c:if>
                                </td>
                                <td id="${report.id }">
                                    <span name="editModel" <c:if test="${report.status == '待提交'|| report.status == '已拒绝'}">class="hand-like"
                                          onClick='toEditProgress("${report.id}")'</c:if>>修改</span>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty list}">
                        <tr>
                            <td colspan="15"><label class="control-label text-center">无记录</label></td>
                        </tr>
                    </c:if>
                    </tbody>
                    <tr style="background: #f8f8f8">
                        <td colspan="12">
                            <jsp:include page="/WEB-INF/jsp/page.jsp"></jsp:include>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>
<input type="hidden" class="hiddenId" id="modelPlanId" value="">
</body>
</html>
